package com.xinsoft.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xinsoft.common.Response;
import com.xinsoft.entity.dto.*;
import com.xinsoft.entity.po.ScmPurchase;
import com.xinsoft.entity.po.ScmPurchasePlan;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xinsoft.entity.po.SysFileHis;
import com.xinsoft.entity.vo.ScmPurchasePlanPageVo;
import com.xinsoft.entity.vo.ScmPurchasePlanVo;

import java.util.List;

/**
* @author 13370
* @description 针对表【scm_purchase_plan(采购计划)】的数据库操作Service
* @createDate 2023-07-04 14:35:53
*/
public interface ScmPurchasePlanService extends IService<ScmPurchasePlan> {

    /**
     * 暂存采购申请单
     */
    Response<?> addOrUpdate(ScmPurchasePlanDto purchasePlanDto);

    /**
     * 提交采购申请单
     */
    Response<?> submintApprove(ScmPurchasePlanDto purchasePlanDto);

    /**
     * 新增节点
     * @param sourceCode 源单编码
     * @param sourceId 源单id
     * @param tabName 表单名称
     * @param num 新增节点顺序
     */
    void approveNodeAdd(String sourceCode, Integer sourceId, Integer sourceType, Integer num, String tabName);

    Response<?> del(List<Long> ids);

    /**
     * 分页
     */
    Response<?> findPageListByParam(ScmPurchasePlanPageParam scmPurchasePageParam);

    /**
     * 分页
     */
    List<ScmPurchasePlanPageVo> findListByParam(ScmPurchasePlanPageParam scmPurchasePageParam);

    /**
     * 获取采购申请单详情
     */
    ScmPurchasePlanVo getScmPurchase(Integer id);

    /**
     * 审批采购申请单
     */
    Response<?> approved(Integer id, Integer type, Integer result, Integer transferId, String desc);

    /**
     * 驳回采购申请单
     */
    Response<?> rejection(Integer id);

    /**
     * 转派采购申请单
     */
    Response<?> transfer(Integer id, Integer transferee);

    SysCountDTO inPurchase();
}
